local M = _G.ServerOHOH.class.new(script,_G.ServerOHOH.files.Server_PlayerComponent(),script.Parent.Name);
local ServerOHOH = _G.ServerOHOH;
local ItemTool=_G.CommonOHOH.load.ItemTool()
local game_cfg = ServerOHOH.config.Game
local function_list = ServerOHOH.function_list;

function M.new(self,...)
    M(self,...);
end

function M.ctor(self,parent)
    M.super.ctor(self,parent)
    self.player = self.parent
    self.DataStore = self.parent:GetComponent(_G.ServerOHOH.load.Server_PlayerDataComponent());
    self.RngDataCtrl=self.parent:GetComponent(_G.CommonOHOH.load.Common_RngDataLayer())

end

function M.AddRollSpeed(self,isActive)
    local gamepass = self.DataStore:GetData("gamePass")
    if gamepass["quick_roll_speed"] and isActive then
        self.RngDataCtrl:AddRollSpeed(game_cfg.fastRoll)
    else
        self.RngDataCtrl:AddRollSpeed(-game_cfg.fastRoll)
    end
end


function M.dtor(self)
    M.super.dtor(self)
end
 
M:RegistFunction(function_list.add_roll_speed,M.AddRollSpeed)

return M